<template>
  <el-card class="page-container">
    <template #header>
      <div class="header">
        <span>{{title}}</span>
        <div class="extra">
          <slot name="extra"></slot>
        </div>
      </div>
    </template>
    <slot></slot>
  </el-card>
</template>

<script>
export default {
  name: 'PageContainer',
  props: {
    title: {
      type: String,
      required: true
    }
  }
}
</script>

<style scoped>
.page-container {
  min-height: 100%;
  border: none; /* 去除边框 */
  box-shadow: none; /* 去除阴影 */
  margin-bottom: 20px;
  box-sizing: border-box;
}
.header {
  display: flex;
  justify-content: space-between; /* 使标题和extra部分左右分布 */
  align-items: center;
  height: 15px;
}
</style>
